package com.yh.csx.crm.core.enums;

/**
 * ApprovalFlowEnum class
 * 审批列表类型：01：我的申请，02：待我审批，03：我已处理
 * @author huyalin
 * @date 2019/2/22
 */
public enum ApprovalListTypeEnum {
    MY("01", "我的申请"),
    TODO("02", "待我审批"),
    COMPLETED("03", "我已处理");

    private String code;
    private String name;

    ApprovalListTypeEnum(String code, String name) {
        this.code = code;
        this.name = name;
    }

    public String getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    public static ApprovalListTypeEnum get(String code) {
        for (ApprovalListTypeEnum approvalFlowEnum: ApprovalListTypeEnum.values()) {
            if (approvalFlowEnum.code.equals(code)) {
                return approvalFlowEnum;
            }
        }
        return null;
    }
}
